home *** CD-ROM | disk | FTP | other *** search
- [DESCRIPTION]Lights up the cells of a table as the mouse moves over them.[/DESCRIPTION]
-
- [HEAD CODE]<script language="JavaScript1.2">
-
- <!--
- //Highlight Table Cells -- By Dynamic Drive
- //For full source code and more DHTML scripts, visit http://www.dynamicdrive.com
- //This credit MUST stay intact for use
-
- var ns6=document.getElementById&&!document.all
- var ie=document.all
-
- function changeto(e,highlightcolor){
- source=ie? event.srcElement : e.target
- if (source.tagName=="TR"||source.tagName=="TABLE")
- return
- while(source.tagName!="TD"&&source.tagName!="HTML")
- source=ns6? source.parentNode : source.parentElement
- if (source.style.backgroundColor!=highlightcolor&&source.id!="ignore")
- source.style.backgroundColor=highlightcolor
- }
-
- function contains_ns6(master, slave) {
- while (slave.parentNode)
- if ((slave = slave.parentNode) == master)
- return true;
- return false;
- }
-
- function changeback(e,originalcolor){
- if
- (ie&&(event.fromElement.contains(event.toElement)||source.contains(event.toElement)||source.id=="ignore")||source.tagName=="TR"||source.tagName=="TABLE")
- return
- else if (ns6&&(contains_ns6(source, e.relatedTarget)||source.id=="ignore"))
- return
- if (ie&&event.toElement!=source||ns6&&e.relatedTarget!=source)
- source.style.backgroundColor=originalcolor
- }
-
- -->
- </script>[/HEAD CODE]
-
- [BODY CODE][/BODY CODE]
-
- [NOTES]To use this script, place the following code inside a table tag:
-
- onMouseover = "changeto(event, '#FFDD00')" onMouseout = "changeback(event, '#FFFFFF')"
-
- To exclude a cell from being highlighted, place this code inside the <td> tag:
-
- id="ignore"[/NOTES]